package com.neusoft.crm.controller;


import com.neusoft.crm.mapper.DataServerTypeMapper;
import com.neusoft.crm.po.DataServerType;
import com.neusoft.crm.service.DataServerTypeService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class DataServerTypeController {

    @Resource
    private DataServerTypeMapper dataServerTypeMapper;
    @Resource
    private DataServerTypeService dataServerTypeService;

    @RequestMapping("/selectAllServerType")
    public List<DataServerType> selectAllServerType(){
        return dataServerTypeMapper.selectList(null);
    }

    @RequestMapping("/deleteServerInfoData")
    public  int deleteServerInfoData(@RequestBody DataServerType dataServerType){
        return dataServerTypeMapper.deleteById(dataServerType);
    }

    @RequestMapping("/addServerInfoData")
    public int addServerInfoData(@RequestBody DataServerType dataServerType){
        return dataServerTypeMapper.insert(dataServerType);
    }

    @RequestMapping("/updateServerInfo")
    public int updateServerInfo(@RequestBody DataServerType dataServerType){
        return dataServerTypeMapper.updateById(dataServerType);
    }
}
